/***************************************************
 @Name :        小铭同学
 @Time :        2025-09-03
 @Email :       LiaoMingWJ233@163.com
 @Comment :     震动马达 控制
 @FileName :    vibratordevice.h
 @Version :     1.0
****************************************************/


#ifndef VIBRATORDEVICE_H
#define VIBRATORDEVICE_H

#include <QObject>
#include <QWidget>
#include <QDebug>
#include <QThread>

extern "C"
{
#include "hal_device.h"
}

class VibratorDevice : public QObject
{
    Q_OBJECT
public:
    explicit VibratorDevice(QObject *parent = nullptr);
    
    void VibratorTurn(int strong_magnitude);
    ~VibratorDevice();
signals:
    
};

class VibratorThread : public QThread
{
public:
    int frequency;
    VibratorDevice*vibrator;

public:
    VibratorThread(VibratorDevice*vibrator):vibrator(vibrator){}

    void run() override
    {
        vibrator->VibratorTurn(frequency);
    }
};

#endif // VIBRATORDEVICE_H
